<?php

/**
 *知识问答
 */
$sql = "
CREATE TABLE IF NOT EXISTS " . tablename('tim_quiz') . " (
`id` int(10) unsigned  AUTO_INCREMENT,
`uniacid` int(11) NOT NULL,
`pagenum` int(3),
`qid` int(11) NOT NULL,
`question` varchar(200) NOT NULL,
`cent` float,
`type` varchar(10),
`ans_a` varchar(100),
`ans_b` varchar(100),
`ans_c` varchar(100),
`ans_d` varchar(100),
`pic_a` varchar(200) DEFAULT NULL,
`pic_b` varchar(200) DEFAULT NULL,
`pic_c` varchar(200) DEFAULT NULL,
`pic_d` varchar(200) DEFAULT NULL,
`pic_a_intro` varchar(50) DEFAULT NULL,
`pic_b_intro` varchar(50) DEFAULT NULL,
`pic_c_intro` varchar(50) DEFAULT NULL,
`pic_d_intro` varchar(50) DEFAULT NULL,
`correct_ans` varchar(10) NOT NULL,
 PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
pdo_query($sql);

$sql = "
CREATE TABLE IF NOT EXISTS " . tablename('tim_quiz_setting') . " (
`id` int(10) unsigned  AUTO_INCREMENT,
`uniacid` int(11) NOT NULL,
`title` varchar(40) NOT NULL,
`copyright` varchar(100),
`total` int(5),
`tnum` int(5),
`dtnum` int(5),
`duration` int(5),
`score_scope11` varchar(200),
`score_scope12` varchar(200),
`praise1` varchar(200),
`score_scope21` varchar(200),
`score_scope22` varchar(200),
`praise2` varchar(200),
`score_scope31` varchar(200),
`score_scope32` varchar(200),
`praise3` varchar(200),
`score_scope41` varchar(200),
`score_scope42` varchar(200),
`praise4` varchar(200),
`score_scope51` varchar(200),
`score_scope52` varchar(200),
`praise5` varchar(200),
`adv` varchar(200),
`adv_link` varchar(200),
`prize` text,
`rule` text,
`link` varchar(200),
`link1` varchar(200),
`link2` varchar(200),
`link3` varchar(200),
`link4` varchar(200),
`text_url` varchar(200),
`share_title` varchar(100),
`share_icon` varchar(200),
`share_content` varchar(200),
 PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
pdo_query($sql);

$sql = "
CREATE TABLE IF NOT EXISTS " . tablename('tim_quiz_user') . " (
 `id` int(10) unsigned  AUTO_INCREMENT,
 `uniacid` int(11) NOT NULL,
 `openid` varchar(200) NOT NULL,
 `nickname` varchar(100) NOT NULL,
 `headimgurl` varchar(200) NOT NULL,
 `score` int(10),
 `tcent` int(5),
 `answer_time` date,
 `isshare` boolean DEFAULT false, 
 `hnum` int(5),
 `lost_time` int(11),
 PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
pdo_query($sql);



